Merged
Conversation
7 tasks
adriengivry
commented
Apr 8, 2026
Comment on lines
+75
to
+97
| // First try matching by script name (stem without path or extension) | ||
| OvCore::ECS::Components::Behaviour* behaviour = nullptr; | ||
| for (auto& [key, b] : p_this.GetBehaviours()) | ||
| { | ||
| if (std::filesystem::path(b.name).stem().string() == p_name) | ||
| { | ||
| behaviour = &b; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| // Fall back to path-based match: try as-is, then with .lua appended if no extension given | ||
| if (!behaviour) | ||
| { | ||
| behaviour = p_this.GetBehaviour(p_name); | ||
| } | ||
|
|
||
| if (!behaviour && std::filesystem::path(p_name).extension().empty()) | ||
| { | ||
| behaviour = p_this.GetBehaviour(p_name + ".lua"); | ||
| } | ||
|
|
||
| if (behaviour) |
Member
Author
There was a problem hiding this comment.
I'm not exactly thrilled about this, but this is necessary to keep all the GetBehaviour("{name}") from breaking after this update. Another option would be to move this code to GetBehaviour itself, but having lua-specific code in there wouldn't make much sense. Could definitely be improved in the future tho.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously, Overload always created a
Scripts/folder inside of a user's project folder.Scripts can now be located anywhere inside of the project's
Assets/folder.This allow scripts to be placed anywhere, including inside of sub-folders.
Technically this would be a breaking change, but a nice window has been added to automatically relocate scripts from
Scripts/toAssets/Scripts/when an old project is opened.In Lua, behaviours can be retrieved using
GetBehaviour:Related Issue(s)
Fixes #385
Review Guidance
Write here.
Screenshots/GIFs
Checklist